<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color:yellow;
        }
        .title {
            font-size: 30px;
            color:red;
        }
    </style>
</head>
<body>
<div class="title">我的个人h5页面</div>
<button type="button" onclick="openHmPhoto()">打开相册</button>
<img id="myImg" style="width:100px;height:100px"></img>
<div id="showImgUrl"></div>
<script>
    function openHmPhoto(){
        window.swift.openPhoto() //如果鸿蒙端该方法是异步，则不能直接调用
        //调用鸿蒙的业务方法
        //var url = window.swift.openPhoto() //如果鸿蒙端该方法是异步，则不能直接调用
        //document.querySelector("#myImg").src = url
        //document.querySelector("#showImgUrl").innerHTML = url
    }

    function setImageUrl(url){
        document.querySelector("#myImg").src = url
        document.querySelector("#showImgUrl").innerHTML = url
    }
</script>
</body>
</html>